import {createVNode} from "vue"
import span from "@/utils/span-solt.vue"

export const firewallout = [
    {
        title: '策略名称',
        dataIndex: 'name',
    },
    {
        title: '协议',
        dataIndex: 'protocol',
        slots: {
            customRender: 'protocol'
        },
        slotsType: 'format',
        slotsFunc: (val) => ({
            0: 'TCP',
            1: 'UDP',
            2: 'TCP,UDP'
        }[val])
    },
    {
        title: '远程地址区间',
        dataIndex: 'ipstr',
        slots:{
            customRender: 'ipstr'
        },
        slotsType: 'component',
        slotsFunc: (record) => createVNode(span,{text:record.externalipstr+"~"+record.externalendipstr})
    },
    {
        title: '远程端口区间',
        dataIndex: 'ports',
        slots: {
            customRender: 'ports'
        },
        slotsType: 'component',
        slotsFunc: (record) => createVNode(span, {text:record.externalport + "~" + record.externalendport})
    },
    {
        title: '是否启用',
        dataIndex: 'using',
        slots: {
            customRender: 'using'
        },
        slotsType: 'format',
        slotsFunc: (val) => ({
            1: '是',
            0: '否'
        }[val])
    },
]
